/*
创建数据模型 和 mongdb的数据表做关联
1. 创建scheme对象
2. 将schema对象转化为数据模型
3. 调用数据模型下的方法操作数据库
*/ 
const mongoose = require("mongoose")

const Schema = mongoose.Schema;
let bannerSchema = new Schema({
  path: { type: String, required: true },
  push: { type: String, default: "0" }, // 1发布 0未发布
  link: { type: String, default: "/" },
  ctime: { type: Date, default: Date.now },
});

let bannerModel = mongoose.model("banner",bannerSchema)

module.exports = bannerModel
